-
Notifications
You must be signed in to change notification settings - Fork 8
Add support for ValueTuple query parameters #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add support for ValueTuple query parameters #14
Conversation
8c17a8f to
92f7125
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for ValueTuple as query parameters in ClickHouse.Driver. Previously only reference-type Tuple was supported, but modern C# code typically uses value-type ValueTuple (e.g., ("a", 1)). This change enables developers to pass ValueTuple parameters directly without manual conversion.
Key Changes:
- Type converter extended to recognize
ValueTupleand map it to ClickHouseTupletype - Test coverage added for both simple and nested
ValueTupleparameters
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| ClickHouse.Driver/Types/TypeConverter.cs | Adds ValueTuple type detection and conversion to ClickHouse Tuple type |
| ClickHouse.Driver.Tests/Types/TypeMappingTests.cs | Adds test case verifying ValueTuple maps to ClickHouse Tuple type |
| ClickHouse.Driver.Tests/SQL/SqlParameterizedSelectTests.cs | Adds integration tests for simple and nested ValueTuple parameters in SQL queries |
|
@alex-clickhouse Hi, could you let me know if there are any blockers or anything else needed before this PR can be merged? |
Previously, only
Tuplewas supported.Many modern C# APIs and user code prefer
ValueTuple, which is also the default type for inline tuples in C# like("a", 1). Without this, developers had to manually convertValueTupletoTuplebefore passing parameters.This change adds
ValueTuplesupport with minimal code changes.